<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use DB;
class Area extends Model
{
    /**
     * 表名称
     * @var $table ;
     */
    protected $table = 'area';

    /**
     * 主键
     * @var $primaryKey
     */
    protected $primaryKey = 'brand_id';


    /**
     * 时间戳   禁止
     * @var bool $timestamps
     */
    public $timestamps = false;

    /**
     * 自动填充字段
     * @var $fillable
     */

    protected $fillable = [ 'parent_id', 'name', 'id'];


    public static function getArea(){


        $province = DB::table('area_province')->get();

        $city = DB::table('area_city')->get();

        $district = DB::table('area_district')->get();

        $area = array_merge($province,$city,$district);

        return new Collection($area);

    }


}
